package com.zlll.winner.service.bbs;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zlll.winner.business.model.bbs.BbsSubjectCity;
import com.zlll.winner.enums.CommonEnum;
import com.zlll.winner.mapper.bbs.BbsSubjectCityMapper;
import com.zlll.winner.business.service.bbs.IBbsSubjectCityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.Service;

/**
 * <p>
 * 话题投放城市表 服务实现类
 * </p>
 *
 * @author Walert
 * @since 2019-09-16
 */
@Service
public class BbsSubjectCityServiceImpl extends ServiceImpl<BbsSubjectCityMapper, BbsSubjectCity> implements IBbsSubjectCityService {


    /**
     * 根据话题ID查找相关城市列表
     *
     * @param subjectId
     * @return
     */
    @Override
    public Object getCityListBySubjectId(Long subjectId) {
        QueryWrapper<BbsSubjectCity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda()
                .eq(BbsSubjectCity::getIsDel, CommonEnum.DelEnum.UNDEL.val())
                .eq(BbsSubjectCity::getSubjectId,subjectId);
        return baseMapper.selectList(queryWrapper);
    }
}
